<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class THisdataPower extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_hisdata_power', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('hd_index')->nullable(false)->comment('');
			$table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->datetime('hd_datetime')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('hd_PhaVol_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LinVol_CA', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaCur_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_NA_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PowFac_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaVol_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LinVol_AB', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaCur_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_NA_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PowFac_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaVol_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LinVol_BC', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaCur_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_NA_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PowFac_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AvePhaVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AveLinVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AvePhaCur', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_Freq', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PowFac_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PosActEne', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_NegActEne', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PosReaPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_NegReaPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LocAddr', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LoadMode', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_Baud', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_InputVolRan', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PTValue', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_CTValue', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_LigInt', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaOutload_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaOutload_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaOutload_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaEne_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaEne_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PhaEne_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AveLoad', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('hd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('hd_index', 'hd_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_hisdata_power');
    }
}
